home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000084_icon-group-sender _Mon Jun 15 08:24:33 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17293
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 15 Jun 1998 08:24:32 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA18164; Mon, 15 Jun 1998 08:24:23 -0700
From: shamim@Synopsys.COM (Shamim Zvonko Mohamed)
Message-Id: <9806150114.AA18119@bermuda.synopsys.com>
Subject: Re: Directory access facilities
To: jeffery@cs.utsa.edu
Date: Sun, 14 Jun 1998 18:14:18 -0700 (PDT)
Cc: ok@atlas.otago.ac.nz, abrahams@acm.org, icon-group@optima.CS.Arizona.EDU
In-Reply-To: <199806020443.XAA08820@segfault.cs.utsa.edu> from "Clinton Jeffery" at Jun 1, 98 11:43:37 pm
X-Mailer: ELM [version 2.4 PL24]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1112
Clint writes:
> Anyone else have ideas (or votes) on how to do directory access
> facilities?
My admittedly biased and possibly Unix-centric view: we don't need any
elaborate solutions, I think the idea of each read() returning one entry
from the directory is the best one. This finesses all the issues of quoting
blanks, quotes, wildchars etc. etc. If you need more information about the
entry, you use the function that performs this query. In Unicon, you use
stat(), which returns a record. Here's the "ls" example:
f := open(".") | stop( ... )
while write( format( stat( read(f) ) ) )
(For clarity I left out some pretty features like sorting the names, and
that you'd want to use lstat instead of stat, etc. Look at the Unicon docs
for more info.)
Someone wanted a directory to be like a table. Yes, a directory is a
"lookup" type of object but not on all systems. We should stick to a clean
and simple interface that will work unambiguously without all sorts of
special cases. Others have already pointed out why a space-separated
string of all the entries is a bad idea.
-s
Shamim Mohamed